how to solve wave equation